<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>JSX创建虚拟DOM</title>
  <!--按顺序引入-->
  <script src="../js/react.development.js"></script>
  <script src="../js/react-dom.development.js"></script>
  <script src="../js/babel.min.js"></script>
  <style>
    body {
      background-color: dimgray;
      color: white;
    }
  </style>
</head>
<body>
<div id="app"></div>

<script type="text/babel">
  // 创建虚拟DOM jsx
  const VDOM = (
      <h1 id="test">hello react
        <span>jsx</span>
      </h1>
  )

  // 创建虚拟DOM js
  //const VDOM = React.createElement('h1', {id: 'test'}, 'hello react js')
  // 渲染
  ReactDOM.render(VDOM, document.getElementById(('app')))
</script>
</body>
</html>
